//
//  UILabel+extension.m
//  Cat
//
//  Created by 张伟 on 2021/4/17.
//

#import "UILabel+extension.h"

@implementation UILabel (extension)

- (void)lineSpace:(CGFloat)space{
    NSMutableParagraphStyle  *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    [paragraphStyle setLineSpacing:space];
    NSString  *testString = self.text;
    NSMutableAttributedString  *setString = [[NSMutableAttributedString alloc] initWithString:testString];
    [setString  addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [testString length])];
    // 设置Label要显示的text
    [self setAttributedText:setString];
}

@end
